import { createSlice } from '@reduxjs/toolkit'

export const userInfoSlice = createSlice({
  name: 'userInfo',
  initialState: localStorage.getItem('userInfo') || null,
  reducers: {
    set: (_, action) => {
      return action.payload
    }
  }
})

export const { set } = userInfoSlice.actions

export default userInfoSlice.reducer
